package com.shamrock.cms.dao;

import com.shamrock.cms.entity.Authorities;
import java.util.List;

import org.springframework.stereotype.Repository;

@Repository("authoritiesDao")
public interface AuthoritiesDao {
	/**
	 * 获取总数
	 * @return
	 */
    public int count();
    /**
     * 删除
     * @param authorities
     * @return
     */
    public int delete(Authorities authorities);
    /**
     * 添加
     * @param authorities
     * @return
     */
    public int add(Authorities authorities);
    /**
     * 获取所有记录
     * @return
     */
    public List<Authorities> getAllList();
    /**
     * 通过role获取记录
     * @param role
     * @return
     */
    public Authorities getAuthoritiesByRole(String role);
    
    /**
     * 通过url获取记录
     * @param role
     * @return
     */
    public List<Authorities> getAuthoritiesByResource(String resource);
    /**
     * 更新记录
     * @param authorities
     * @return
     */
    public int updateById(Authorities authorities);
    /**
     * 通过role更新记录
     * @param role
     * @param authorities
     * @return
     */
    public int updateByRole(String role, Authorities authorities);
}